#ifndef QLIB_LIBRARYDOCK_H
#define QLIB_LIBRARYDOCK_H

#include <QtGui/qdockwidget.h>

QT_FORWARD_DECLARE_CLASS(QComboBox)
QT_FORWARD_DECLARE_CLASS(QStackedWidget)
QT_FORWARD_DECLARE_CLASS(QTreeWidget)

namespace Utils {
    class FilterLineEdit; // Qt Creator class
}

class LibraryModel;
class LibraryTree;
class QedaComponent;

class LibraryDock : public QDockWidget
{
    Q_OBJECT
public:    
    explicit LibraryDock(LibraryModel *libModel, QWidget *parent = 0);
    
    void setWidth(int w);

public slots:

signals:
    void componentEditRequested(QedaComponent *component);

private slots:
    void changeArrangeMode(int mode);
    void collapseAll();
    void expandAll();
    void restoreMinMaxSizes();

private:
    QWidget *createFilter();

private:
    QStackedWidget          *m_trees;
    QStackedWidget          *m_filters;
    Utils::FilterLineEdit	*m_regExp;
    QComboBox               *m_arrangeBox;
    LibraryModel            *m_libModel;
    int                      m_oldMinWidth;
    int                      m_oldMaxWidth;
};

#endif // QLIB_LIBRARYDOCK_H
